<template>
    <div>
      <h1>Hello App !</h1>
      <p>
        <router-link to="/foo"></router-link>
      </p>
    </div>
</template>
<script>
export default {
  name: 'routerDemo',
  data () {
    return {
      title: 'routerDemo 路由器测试'
    }
  },
  methods: {
    totalPrice: function () {
    }
  },
  watch: {
  },
  directives: {
    'focus': {
      inserted: function (el) {
        el.focus()
      }
    },
    'runoob': {
      'bind': function (el, binding, vnode) {
        var s = JSON.stringify
        el.innerHTML =
          'name: ' + s(binding.name) + '<br>' +
          'value: ' + s(binding.value) + '<br>' +
          'expression: ' + s(binding.expression) + '<br>' +
          'argument: ' + s(binding.arg) + '<br>' +
          'modifiers: ' + s(binding.modifiers) + '<br>' +
          'vnode keys: ' + Object.keys(vnode).join(', ')
      }
    },
    'delong_order': function (el, binding) {
      // 简写方式设置文本及背景颜色
      el.innerHTML = binding.value.text
      el.style.backgroundColor = binding.value.color
    }
  }
}
</script>
